package com.twu.biblioteca;

/**
 * Created with IntelliJ IDEA.
 * User: ama
 * Date: 13/10/13
 * Time: 1:29 PM
 */
public class Movie {
    private String title;
    private int year;
    private String director;
    private String rating;
    private final String RATING_UNAVAILABLE = "N/A";
    private String outOfTen;


    public Movie(String title, int year, String director) {
        this.title = title;
        this.year = year;
        this.director = director;
        this.rating = RATING_UNAVAILABLE;
    }

    public Movie(String title, int year, String director, String rating) {
        this.title = title;
        this.year = year;
        this.director = director;
        outOfTen = "/10";
        this.rating = rating + outOfTen;
    }

    public String toString() {
        return String.format("%s\t%s\t%s\t%s", title, String.valueOf(year), director, rating);
    }

}
